<template>
  <div>

     <div>{{str}}</div>

        <br>
        <br>
      <button @click="reverseStr">逆转</button>

  </div>

</template>
 
<script>
export default {

  data() {
    return {
        str:'Hello,World'
    };
  },

  methods: {
    //翻转字符串
    reverseStr(){
        this.str = this.str.split('').reverse().join('')
    }  
    
  }
};
</script>

<style scoped>
     
</style>